package com.xxxx.server.pojo.param;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @program: yeb
 * @description: 用于注册账号的用户参数类
 * @author: xzl
 * @create: 2021-11-16 10:22
 **/
@Data
public class AdminParam {

    @ApiModelProperty(name = "id",hidden = true)
    private Integer id;

    @ApiModelProperty(value = "姓名")
    @NotBlank(message = "不能为空！")
    private String name;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "住宅电话")
    @Size(min = 11, max = 11, message = "手机号码长度不正确")
    @Pattern(regexp = "^(((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(16[6])|(17[0135678])|(18[0-9])|(19[89]))\\d{8})$", message = "手机号格式错误")
    private String telephone;

    @ApiModelProperty(value = "密码")
    @NotBlank(message = "不能为空！")
    @Size(min = 8, max = 15, message = "密码长度不正确")
    @Pattern(regexp = "(?!^(\\d+|[a-zA-Z]+|[~!@#$%^&*?]+)$)^[\\w~!@#$%\\^&*?]+$",message = "密码必须包含字母、数字或特殊字符两种及以上！")
    private String password;

    @ApiModelProperty(value = "确认密码")
    @NotBlank(message = "不能为空！")
    @Size(min = 8, max = 15, message = "密码长度不正确")
    @Pattern(regexp = "(?!^(\\d+|[a-zA-Z]+|[~!@#$%^&*?]+)$)^[\\w~!@#$%\\^&*?]+$",message = "密码必须包含字母、数字或特殊字符两种及以上！")
    private String confirmPassword;

    @ApiModelProperty(value = "邮箱")
    @NotBlank(message = "不能为空！")
    @Pattern(regexp = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$",message = "格式不正确！")
    private String email;

    @ApiModelProperty(value = "管理员或普通用户")
    private String userOrAdmin = "user";

    @ApiModelProperty(value = "验证码")
    private String code;

}
